<?xml version="1.0"?>
<jsp:root 	xmlns:jsp="http://java.sun.com/JSP/Page"
			xmlns:sql="http://java.sun.com/jsp/jstl/sql"
			xmlns:c="http://java.sun.com/jsp/jstl/core" 
			xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
			version="2.1">
	<jsp:directive.page contentType="text/html; charset=UTF-8" />
	<jsp:directive.page isELIgnored="false" />
	<jsp:output omit-xml-declaration="false"
		doctype-root-element="html"
		doctype-public="-//W3C//DTD XHTML 1.1//EN"
		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd" /> 	
		
	<jsp:useBean id="userBean" class="es.albarregas.beans.UserBean" scope="session" />	
	<jsp:useBean id="productList" class="es.albarregas.beans.ProductListBean" scope="session" />
	
<!--[if lt IE 8]>      <html class="no-js lt-ie10 lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie10 lt-ie9"> <![endif]-->
<!--[if IE 9]>         <html class="no-js lt-ie10"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
  <head>
    <meta charset="utf-8" />
    <title>Ikex | Confirmar y Pagar</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Ikex Furniture Store" />
    <meta name="author" content="Josu Becerra" />

	<!-- Favicon y Apple touch icons (botones para Ipad y Iphone) -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/apple-touch/144.png" ></link>
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/apple-touch/114.png" ></link>
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/apple-touch/72.png" ></link>
    <link rel="apple-touch-icon-precomposed" href="images/apple-touch/57.png" ></link>
    <link rel="shortcut icon" href="images/favicon.png" ></link>

    <!--  Google Fonts  -->
    <link href='http://fonts.googleapis.com/css?family=Pacifico|Open+Sans:400,700,400italic,700italic&amp;subset=latin,latin-ext,greek' rel='stylesheet' type='text/css' />
    
    
    <!-- Twitter Bootstrap; librería ventanas JQuery-->
    <link href="css/bootstrap.css" rel="stylesheet" ></link>
    <link href="css/responsive.css" rel="stylesheet" ></link>
    <!-- Slider Revolution -->
    <link rel="stylesheet" href="js/rs-plugin/css/settings.css" type="text/css" ></link>
    <!-- jQuery UI -->
    <link rel="stylesheet" href="js/jquery-ui-1.10.3/css/smoothness/jquery-ui-1.10.3.custom.min.css" type="text/css" ></link>
    <!-- PrettyPhoto -->
    <link rel="stylesheet" href="js/prettyphoto/css/prettyPhoto.css" type="text/css" ></link>
    <!-- main styles -->
     
    <link href="css/main.css" rel="stylesheet" ></link>
     
     <!-- JQuery -->
	<!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> -->
	<script type="text/javascript" src="js/jquery.min.js"><jsp:text /></script>

    <!-- Modernizr, librería que le dice al navegador cómo actuar si no soporta la funcionalidad de la página 
    <script src="js/modernizr.custom.56918.js"></script>    -->
 	
  	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  
  </head>
  
  <jsp:useBean 
      id="direccionBean"
      class="es.albarregas.beans.DireccionBean"
      scope="session">  
    </jsp:useBean>
    <jsp:setProperty name="direccionBean" property="*" />
    
    <jsp:useBean 
      id="tarjetaBean"
      class="es.albarregas.beans.TarjetaBean"
      scope="session">  
    </jsp:useBean>
    <jsp:setProperty name="tarjetaBean" property="*" />
   
  <body class="checkout-page">
   
    
   <!-- Carrito  -->
	<jsp:useBean id="listaPedidosBean" class="es.albarregas.beans.PedidoListBean" scope="session" />
	
	<jsp:setProperty property="clausulaWhere" name="listaPedidosBean" value="where user_oid=${userBean.oid} and confirmado=false" />
	  
	<c:if test="${userBean.oid != 0}">
		<c:set var="clausula" 	value=" where user_oid=${userBean.oid} and confirmado=false" />
		<jsp:setProperty property="clausulaWhere" name="listaPedidosBean" value="${clausula}" />
		<c:set var="oidPedido" value="0" />
		<c:set var="totalPedido" value="0"></c:set>
		<c:forEach var="registros" items="${listaPedidosBean.pedido}">
			<c:set var="oidPedido" value="${registros.oid}" />
			<c:set var="totalPedido" value="${registros.total }"></c:set>
			<c:set var="elPedido" value="${registros}"></c:set>
		</c:forEach>
		<c:if test="${oidPedido != 0}">
			<jsp:useBean id="listaLineasPedidoBean" class="es.albarregas.beans.LineasPedidoListBean" scope="session" />
			<c:set var="clausula2" value="where pedido_oid=${oidPedido}" />	
			<jsp:setProperty property="clausulaWhere" name="listaLineasPedidoBean" value="${clausula2}" />
		</c:if>		
    </c:if>  
    
    
    <div class="container">
    <!--  =====================  -->
    <!--  = Detalle Carrito   =  -->
    <!--  =====================  -->  
    <c:choose>
    	<c:when test="${listaPedidosBean.pedido.size() != 0}">
    		<jsp:include page="include/confirmar-carrito.jsp" />
    	</c:when>
    	<c:otherwise>
    		<jsp:include page="include/carrito-vacio.jsp" />
    	</c:otherwise>
    </c:choose>
        
    </div> <!-- /container -->
    
    <!--  ====================  -->
	<!--  = Ventanas modales =  -->
 	<!--  ====================  -->
	<jsp:include page="include/ventanas.jsp" /> 
    
    
    <!--  ==========  -->
    <!--  = JavaScript =  -->
    <!--  ==========  -->
    <script src="js/ajax-detalle-carrito.js"><jsp:text /></script> 
    
    <jsp:include page="include/js.jsp" />
    
    <!-- Scripts de validación JavaScript -->
	<script src="js/validacion.js"><jsp:text /></script> 

  </body>
</html>
</jsp:root>
    
    